// <!--
//  * 严肃声明：
//  * 开源版本请务必保留此注释头信息，若删除我方将保留所有法律责任追究！
//  * 可正常分享和学习源码，不得用于违法犯罪活动，违者必究！
//  * Copyright (c) 2022 APThink David唐 all rights reserved.
//  * 版权所有，侵权必究！
//  *
// -->
import { post, get } from "@/api";
import { type IParameter } from "@/contants"

export function login(account: string, password: string) {
  return post("/login", { account: account, password: password });
}

export function logout() {
  return post("/logout");
}

export function getServerInfo() {
  return post("/auth/serverinfo");
}

export function importAuth(param: any) {
  return post("/auth/importauth", param);
}

export function createAuth(param: any) {
  return post("/auth/create", param);
}

export function getUser() {
  return post("/current");
}

export function getRole() {
  return post("/role/all");
}

export function queryPermission(id: string) {
  return post("/role/querypermission", { id: id });
}

export function updatePermission(data: any) {
  return post("role/updatepermission", data);
}

export function saveColumnset(data: IParameter) {
  console.log(data)
  return post("/saveuserparameter", data);
}

export function getDepartment(id: string) {
  return get("/department/" + id);
}

export function saveSysParam(data: any) {
  return post("/savesystemparameter", data);
}

export function queryUser(params: any) {
  return post("/user/query", params);
}

export function querySession(params: any) {
  return post("/session/query", params);
}

export function clearSession() {
  return post("/session/clear");
}

export function exitSession(sessionId: string) {
  return post("/session/forceexit", {"uid": sessionId});
}

export { all, add, upd, del, query, get, post, userparam, sysparam } from "./request";
